package com.dcliu.workflow.listener;

import java.util.List;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.dcliu.bean.Customer;
import com.dcliu.service.CustomerService;

public class WFStartCompeleteTaskListener  implements TaskListener {

	private static final long serialVersionUID = 1L;
	private static final Logger log = LoggerFactory.getLogger(WFStartCompeleteTaskListener.class);

	private CustomerService demoService;
	
	public void notify(DelegateTask delegateTask) {
		
		System.out.println(delegateTask.getId());
		System.out.println(delegateTask.getName());
		List<Customer> list = demoService.getInfoByUserPhone("1825659520");
		log.info("=================================");
		for (Object object : list) {
			System.out.println(((Customer)object).getUserName());
		}
		log.info("=================================");
	}

	public void setDemoService(CustomerService demoService) {
		this.demoService = demoService;
	}
	
}
